#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QPainter"
#include<config.h>
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    MainScene();

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::MainScene()
{
    //设置窗口尺寸（固定）
    setFixedSize(GAME_WIDTH,GAME_HEIGHT);
    //标题
    setWindowTitle(GAME_TITLE);
    //窗口图标
    setWindowIcon(QIcon(GAME_Icon));
    //主界面按钮
    m_menu.load(GAME_Mainscene_Pic);
    m_menu_x=0;
    m_menu_y=0;


}

void MainWindow::updategame()
{

}

void MainWindow::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    painter.drawPixmap(0,0,1080,720,m_menu);//  尝试绘制地图场景
}
